<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
    <title>岗位列表</title>
    <%@ include file="/WEB-INF/jsp/public/common.jspf" %>
    <link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/style/blue/jquery-ui.min.css" />
<script language="javascript"
	src="${pageContext.request.contextPath}/script/jquery-ui.min.js"></script>
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/style/blue/forum.css" />
	    <script type="text/javascript"
	src="${pageContext.request.contextPath}/script/md5.js"></script>
    <script type="text/javascript">	
 		 $(document).ready(function () {
 			$('.show11').dialog({
 				autoOpen : false,
 				bgiframe : true,
 				width : 400,
 				height : 500,
 				modal : true,
 				buttons : {
 					"返回" : function() {
 						$(this).dialog("close");
 					}
 				}
 			});
 			 var y=document.getElementById("y").innerHTML;
             y=parseInt(y);
  if(y<0){
	  $(".de").show();
  }
 			 var operatorId=document.getElementsByName("operatorId")[0].value;

 			$(".checkp").click(function() {
				var id=parseInt($(this).attr("id"));	
               var ids=operatorId+","+id;
              
               if(y>0){
         		  $.post("GsonServlet",{
                      num:ids
                  }, function (returnedData, status) {           	
                  		var idt=parseInt(returnedData[0]);
                         if(idt==1){
                        	
                        	 document.form.action="rdfile_view.action?rid="+id;
                        	 document.form.target="right";
                        	 document.form.submit();
                        	 return true;
                         }else{
                        	 
                        	 $("#pass").dialog({buttons:{"OK":function() {
                        			var d=$("#pwd").val();
                        			d=hex_md5(d);
                               	 if(d==returnedData[1]){
                               		 $("#pass").dialog("close");
                            		 document.form.action="rdfile_view.action?rid="+id;
                                	 document.form.target="right";
                                	 document.form.submit();                              	
                                	 return true;
                            	 }else{
                            		 alert("密码错误！");                          		 
                            		 return false;
                            	 }
                        		
                        			}
                        	 }});                                            	               
                         }
                  		             	
                  });
               }else{          	   
            	   document.form.action="rdfile_editUI.action?rid="+id;
              	 document.form.target="right";
              	 document.form.submit();
              	 return true;
               }
 
			}); 
 			$('.setD').click(function() {
 				var id=$(this).attr("id");
 				$("#url11").attr("src", "rdfile_setDepartmentUI.action?id="+id);
 				$('.show11').dialog({
 					title : "设置部门"
 				});
 				$('.show11').dialog('open');
 				return false;
 			});
 			$('.setpwd').click(function() {
 				var id=$(this).attr("id");
 				$("#url11").attr("src", "rdfile_setPasswordUI.action?id="+id);
 				$('.show11').dialog({
 					title : "修改密码"
 				});
 				$('.show11').dialog('open');
 				return false;
 			});
 			$("#tt").change(function(){ 
 				var v=$(this).val();
 				if(v==1){
 					$("#ar").show();
 					$("#rd").hide();
 				}else if(v==2){
 					$("#ar").hide();
 					$("#rd").show();
 				}else{
 					$("#ar").show();
 					$("#rd").show();
 				}
 				}) ;

 	
		 }); 

	</script>  
</head>
  <style type="text/css">
.de{
display:none;
}

</style>
<body>
 
<div id="Title_bar">
    <div id="Title_bar_Head">
        <div id="Title_Head"></div>
        <div id="Title"><!--页面标题-->
            <img border="0" width="13" height="13" src="${pageContext.request.contextPath}/style/images/title_arrow.gif"/> 文件
        </div>
        <div id="Title_End"></div>
        <div id="y" style="display:none;">${y}</div>
    </div>
</div>

<s:hidden name="password" ></s:hidden>
<s:hidden name="operatorId" value="%{#session.operator.id}"></s:hidden>
<div id="MainArea">
<div style="padding-left:15px;padding-top:20px">
<s:select name="tt" id="tt" size="1" cssClass="SelectStyle"	list="#{1:'仅显示文章',2:'仅显示附件',3:'全部显示'}" listKey="key" listValue="value" headerKey=""	headerValue="===请选显示类型==="/>
</div>
<center>
		<div class="ForumPageTableBorder" style="margin-top: 25px;">
			<table width="100%" border="0" cellspacing="0" cellpadding="0" id="ar">
			
				<!--表头-->
				<tr align="center" valign="middle">
					<td colspan="3" class="ForumPageTableTitleLeft">相关文章列表</td>
					<td width="60" class="ForumPageTableTitle">文章作者</td>
					<td width="50" class="ForumPageTableTitle">说明</td>
					<td width="50" class="ForumPageTableTitle">上传时间</td>
					<td width="200" class="ForumPageTableTitle">相关操作</td>
				</tr>
				<tr height="1" class="ForumPageTableTitleLine"><td colspan="9"></td></tr>
				<tr height="3"><td colspan="9"></td></tr>
			
				<!--版面列表-->
				<tbody class="dataContainer" datakey="forumList">
				
				<s:iterator value="#articleList" id="art">
					<tr height="78" align="center" class="template">
						<td width="3"></td>
						<td width="75" class="ForumPageTableDataLine">
							<img src="${pageContext.request.contextPath}/style/images/forumpage3.gif" />
						</td>
						<td class="ForumPageTableDataLine" width="200">
							<ul class="ForumPageTopicUl">
								<li class="ForumPageTopic">${name}</li>
								
							</ul>
						</td>
						<td class="ForumPageTableDataLine"><b><s:property value="(#operatorList.{?#art.operatorId==#this.id})[0].username"/>&nbsp;</b></td>
						<td class="ForumPageTableDataLine"><b>${remark}</b></td>
						<td class="ForumPageTableDataLine"><b>${createTime}&nbsp;</b></td>					
						<td class="ForumPageTableDataLine"><b>
						<a href="#" class="checkp" id="${id}">查看</a>
						<div class="de" style="display:none;">
							<s:a action="rdfile_delete?id=%{id}" onclick="return confirm('确定要删除吗？')" >删除</s:a>
						    <a href="#" class="setD" id="${id}">设置部门</a>
						    <a href="#" class="setpwd" id="${id}">修改密码</a>
						</div>
												</b></td>
			
					</tr>
				</s:iterator>						
				</tbody>			
				<tr height="3"><td colspan="9"></td></tr>
			</table>
			
			<table width="100%" border="0" cellspacing="0" cellpadding="0" id="rd">
			
				<!--表头-->
				<tr align="center" valign="middle">
					<td colspan="3" class="ForumPageTableTitleLeft">附件列表</td>
					<td width="60" class="ForumPageTableTitle">作者</td>
					<td width="50" class="ForumPageTableTitle">说明</td>
					<td width="50" class="ForumPageTableTitle">上传时间</td>
					<td width="200" class="ForumPageTableTitle">相关操作</td>
				</tr>
				<tr height="1" class="ForumPageTableTitleLine"><td colspan="9"></td></tr>
				<tr height="3"><td colspan="9"></td></tr>
			
				<!--版面列表-->
				<tbody class="dataContainer" datakey="forumList">
				
				 <s:iterator value="#dfileList" id="df">
					<tr height="78" align="center" class="template">
						<td width="3"></td>
						<td width="75" class="ForumPageTableDataLine">
							<img src="${pageContext.request.contextPath}/style/images/file.jpg" />
						</td>
						<td class="ForumPageTableDataLine" width="200">
							<ul class="ForumPageTopicUl">
								<li class="ForumPageTopic">${name}</li>
								
							</ul>
						</td>
						<td class="ForumPageTableDataLine"><b><s:property value="(#operatorList.{?#df.operatorId==#this.id})[0].username"/>&nbsp;</b></td>
						<td class="ForumPageTableDataLine"><b>${remark}</b></td>
						<td class="ForumPageTableDataLine"><b>${createTime}&nbsp;</b></td>					
						<td class="ForumPageTableDataLine"><b>
						<a href="#" class="checkp" id="${id}">查看</a>
					<div class="de" style="display:none;">	
					<s:a action="rdfile_delete?id=%{id}" onclick="return confirm('确定要删除吗？')" >删除</s:a>
					<a href="#" class="setD" id="${id}">设置部门</a>
					<a href="#" class="setpwd" id="${id}">修改密码</a>
					</div>
												</b></td>
			
					</tr>
				</s:iterator>						
				</tbody>			
				<tr height="3"><td colspan="9"></td></tr>
			</table>
			
			
		</div>
	</center>
	 <div id="InputDetailBar">
            <a href="javascript:history.go(-1);"><img src="${pageContext.request.contextPath}/style/images/goBack.png"/></a>
        </div>
	
<div  id="pass" style="display:none;font-size:18px">请输入密码：<br><input type="password" name="pwd" id="pwd"/></div>

<s:form name="form"  action="">

</s:form>
</div>
<div class="show11" title="增加区域" style="display:none">
		<iframe id="url11" width="400" height="500" frameborder="no"
			scrolling="no"></iframe>
	</div>
</body>

</html>
